﻿using System;
using System.ComponentModel.DataAnnotations;

namespace OperationPlugins.Validators.DataAnnotations
{
    /// <summary>
    /// Provides data for the <see cref="DataAnnotationsValidationResourceResolver.ResolveBranch"/> event.
    /// </summary>
    public sealed class ResolveBranchEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the ResolveBranchEventArgs class.
        /// </summary>
        /// <param name="value">The value to validate.</param>
        /// <param name="validationContext">Describes the context in which a data annotations validation check is performed.</param>
        public ResolveBranchEventArgs(object value, ValidationContext validationContext)
        {
            Value = value;
            ValidationContext = validationContext;
        }

        /// <summary>
        /// The value to validate.
        /// </summary>
        public object Value { private set; get; }

        /// <summary>
        /// Describes the context in which a data annotations validation check is performed.
        /// </summary>
        public ValidationContext ValidationContext { private set; get; }

        /// <summary>
        /// The resolved branch.
        /// </summary>
        public BranchId Resolved { set; get; }
    }
}